﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WaterLevelWarning.aspx.cs" Inherits="GroundWater.waterlevel.WaterLevelWarning" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <script language="javascript" src="../js/common.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server"><asp:ScriptManager ID="scriptManager" runat="server" />
    <div class="region" style="width: 96%; font-size:9pt;">
        <table style="width: 100%;">
            <tr>
                <td>日期从:</td><td><asp:TextBox runat="server"  id="txtStartDate"   />&nbsp;<img onclick="WdatePicker({el:$dp.$('txtStartDate')})" src="../js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle" /></td>
                <td>到:</td><td colspan="2"><asp:TextBox runat="server"  id="txtEndDate"  />&nbsp;<img onclick="WdatePicker({el:$dp.$('txtEndDate')})" src="../js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle" /></td>
                <td>检查类型：</td><td><asp:DropDownList ID="drpType" runat="server" ><asp:ListItem Value="0" Text="水位超高提示" Selected="True"></asp:ListItem><asp:ListItem Value="1" Text="水位超低提示"></asp:ListItem></asp:DropDownList></td>
                <td><asp:Button ID="btnCheck" runat="server" Text="检查"  onclick="btnCheck_Click"  OnClientClick="return validateData();" />&nbsp;&nbsp;<asp:Button ID="btnExport" runat="server" Text="  导出  "  OnClick="btnExport_Click" OnClientClick="if(!isDate(txtStartDate) || !isDate(txtEndDate)) { alert('日期格式不正确！'); return false; } if(!document.getElementById('gvWarning')) {alert('没有异常水位信息，如果您还没有检查，请先检查一下，确保有异常水位！'); return false;}" /></td>
            </tr>
<%--            <tr>
                <td>高水位警戒值：</td><td><asp:TextBox  id="txtMax" runat="server" Width="50" Text="0.20" /></td>
                <td>低水位警戒值：</td><td><asp:TextBox  id="txtMin" runat="server" Width="50" Text="0.20" /></td>
                
            </tr>--%>
        </table>
    </div>
    
    <div style="width:100%; margin-top:10px;" id="laseWarning" runat="server" >
        <p style="font-weight:bold; font-family:Tahoma; margin-bottom:8px; "></p>
        <div class="grid">
            <div class="rounded">
                <div class="top-outer"><div class="top-inner"><div class="top">
                    <h2>水位检查</h2>
                </div></div></div>
                <div class="mid-outer"><div class="mid-inner"><div class="mid">
                
                <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                          
                            <asp:GridView  ID="gvWarning" runat="server"   SkinID="DefaultGridView"  OnRowDataBound="RowDataBound" EnableViewState="false" >
                                <Columns>
                                    <asp:BoundField  HeaderText="水井编号" DataField="WellCode"  HeaderStyle-CssClass="first" ItemStyle-CssClass="first" />
                                    <asp:BoundField  HeaderText="水井名称" DataField="WellName"  />
                                    <asp:BoundField  HeaderText="监测时间" DataField="MonitorTime" DataFormatString="{0:yyyy-MM-dd HH:mm}" HtmlEncode="false"     />
                                    <asp:BoundField  HeaderText="水位" DataField="Waterlevel"  DataFormatString="{0:N2}"     />
                                    <asp:BoundField  HeaderText="最低警戒水位" DataField="MinimumWaterlevel"  DataFormatString="{0:N2}"     />
                                </Columns>
                            </asp:GridView>
                            
                            <asp:Literal ID="lblEmpty" EnableViewState="false" runat="server"></asp:Literal>
                            
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnCheck" />
                        </Triggers>
                    </asp:UpdatePanel> 
                            
                </div></div></div>
            <div class="bottom-outer"><div class="bottom-inner">
            <div class="bottom"></div></div></div>                   
        </div>      
        </div>
    </div>
    
    
<asp:updateprogress id="updateProgress" runat="server" DynamicLayout="true" DisplayAfter="800">
    <progresstemplate>
        <div id="progressBackgroundFilter"></div>
        <div id="processMessage">正在处理数据，请稍等...<br /><br /><img alt="Loading" src="../images/loading_16.gif" /></div>
    </progresstemplate>
</asp:updateprogress>
    
    </form>
    
<script type="text/javascript">
//<![CDATA[
    function validateData() {
        
    var message = "";
    if (!notEmpty($get("txtStartDate"))) {
        message += "起始日期不能为空。\n";
    }
//    if (!isNum($get("txtMax").value)) {
//        message += "高水位警戒值为数值。\n";
//    }
//    if (!isNum($get("txtMin").value)) {
//        message += "低水位警戒值为数值。\n";
//    }

    if (!validateCNDate($get("txtStartDate").value)) {

        message += "起始日期格式不正确。\n";
    }
    if (!validateCNDate($get("txtEndDate").value)) {

        message += "截至日期格式不正确。\n";
    }

//    if (parseFloat($get("txtMax").value) <= 0) {
//        message += "高水位警戒值要大于0。\n";
//    }

    if (message.length > 0) {
        alert(message);
        return false;
    }
    return true;
}
//]]>
</script>
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
</body>
</html>
